package com.ywk.pattern._16_state;

public class Eveningstate extends State {
    @Override
    public void WriteProgram(Work work) {
        if (work.isFinish()) {
            work.setCurrent(new RestState());
            work.WritePorgram();
        }else{
            if (work.getHour() < 21) {
                System.out.println("晚上工作，精神百倍"+work.getHour());
            }else{
                work.setCurrent(new SleepingState());
                work.WritePorgram();
            }

        }


    }
}
